<template>
  <div>
    <h3>首页</h3>
    <br>
    <h3>{{ $t('xxx') }}</h3>
    <el-date-picker />
    <el-button @click="btnClick">点击切换语言</el-button>
    <el-calendar />
  </div>
</template>
<script>
import cookieJs from 'js-cookie'
export default {
  methods: {
    btnClick() {
      console.log(this.$t('xxx'))
      this.$i18n.locale = this.$i18n.locale === 'zh' ? 'en' : 'zh'
      cookieJs.set('lang', this.$i18n.locale)
      // 刷新整个网站
      this.$router.go(0)
    }
  }
}
</script>
<style></style>
